#include <stdio.h>
#include <assert.h>
char* my_strncat(char* a, const char* b, int num)
{
	assert(a && b);
	char* ret = a;
	int i = 0;
	while (*a)
	{
		a++;
	}
	for (i = 0; i < num && b[i] != '\0'; i++)
	{
		a[i] = b[i];
	}
	a[i] = '\0';
	return ret;
}


int main()
{
	char a[] = "def";
	char b[20] = "abc";
	my_strncat(b, a, 2);
	printf("%s\n", b);
	return 0;
}